package com.megvii.koala.data.bean;

import java.io.Serializable;
import java.util.ArrayList;

/**
 * Created by linyue on 16/1/11.
 */
public class StaffBean extends CreatureBean implements Serializable, Cloneable
{
    public static final String ID_NEW_TODAY = "ID_NEW_TODAY";

    public static final String ID_NOPHOTO = "ID_NOPHOTO";

    public static StaffBean fromCreatureBean(CreatureBean creature)
    {
        //TODO 写个反射copy变量的工具
        StaffBean staff = new StaffBean();
        staff.id = creature.id;
        staff.avatar = creature.avatar;
        staff.subject_type = creature.subject_type;
        staff.name = creature.name;
        staff.start_time = creature.start_time;
        staff.end_time = creature.end_time;
        staff.visit_notify = creature.visit_notify;
        staff.purpose = creature.purpose;
        staff.remark = creature.remark;
        staff.description = creature.description;
        staff.department = creature.department;
        staff.phone = creature.phone;
        staff.title = creature.title;
        staff.email = creature.email;
        staff.job_number = creature.job_number;
        staff.nameFirst = creature.nameFirst;
        staff.pingyinName = creature.pingyinName;
        staff.zimuName = creature.zimuName;
        staff.come_from = creature.come_from;
        staff.pinyin = creature.pinyin;
        if (creature.photos == null)
        {
            staff.photos = null;
        }
        else
        {
            staff.photos = new ArrayList<>();
            for (UpPictureBean pictureBean : creature.photos)
            {
                UpPictureBean clonedPictureBean = (UpPictureBean) pictureBean.clone();
                staff.photos.add(clonedPictureBean);
            }
        }
        return staff;
    }
}
